TARGET=sdl2
CC=gcc
CXX=g++
CXXFLAGS =-std=c++11
BUILD_OPTION = -static
LINK_OPTION = -mwindows
OBJ=main.o
SRC=main.cpp

ifeq ($(OS),Windows_NT)
	HEADER_PATH = -I.
	LIB_PATH = -L.
else
	ifeq ($(shell uname),Darwin)
		HEADER_PATH = -I /usr/local/include
		LIB_PATH = -L /usr/local/lib/
	else
		HEADER_PATH = -I.
		LIB_PATH = -L.
	endif
endif


LIBS =  -lSDL2 \
		-lSDL2main \
		-lSDL2_image

# LDFLAGS += -lm -lSDL2

$(TARGET):$(OBJ)
	$(CXX) -o $(TARGET) $(LINK_OPTION) $(OBJ) $(LIB_PATH) $(LIBS)

$(OBJ):$(SRC)
	$(CXX) -c -g $(SRC) $(BUILD_OPTION) $(HEADER_PATH) $(CXXFLAGS)

clean:
	rm $(OBJ) $(TARGET)
